package com.moba.emums;

/** @创建人: liujia @创建时间: 2018-08-27 11:08 */
public enum UserLevel {
  USER_LEVEL_200("合格会员", 200),
  USER_LEVEL_201("G1", 201),
  USER_LEVEL_202("G2", 202),
  USER_LEVEL_203("G3", 203),
  USER_LEVEL_204("G4", 204);

  public static String getName(int index) {
    for (UserLevel c : UserLevel.values()) {
      if (c.getIndex() == index) {
        return c.name;
      }
    }
    return null;
  }

  private UserLevel(String name, int index) {
    this.name = name;
    this.index = index;
  }

  private String name;

  private int index;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getIndex() {
    return index;
  }

  public void setIndex(int index) {
    this.index = index;
  }
}
